package com.foreveross.smsh.core.service;
import java.util.List;
import java.util.Map;

import org.hibernate.SQLQuery;
import org.hibernate.criterion.DetachedCriteria;

import com.foreveross.smsh.common.Paginator;

public interface BaseService<T> {
	public T get(String id);

	public List<T> get(String field, Object value);

	public void add(T obj);

	public void update(T obj);

	public void delete(String id);

	public List<T> find(DetachedCriteria criteria);

	public void find(Paginator<T> pagin);

	public int executeSQLUpdate(String sql, Map<String, Object> params);

	public List executeSQLQuery(String sql, Map<String, Object> params);

	public int executeUpdate(String hql, Object... params);

	public List executeQuery(String hql, Object... params);
	public SQLQuery getSQLQuery(String sql, Map<String,Object> params);
}
